package com.apop.common.controller;

import com.apop.common.model.UserAuth;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName PageController
 * @Author Jiayi Zheng
 * @Date 2021/12/27 14:54
 * @Description: todo
 * @Version V1.0
 */
@Controller
@RequestMapping("/p")
public class PageController {

    /**
     * 登陆
     * @return
     */
    @GetMapping("/test")
    public String test() {
        return "user/login";
    }

    @GetMapping("/task")
    public String toTaskMgr(Model model) {

        return "example/task_view";
    }


    /**
     * 首页
     * @param model
     * @return
     */
    @GetMapping("/index")
    public String toIndex(Model model) {

        UserAuth user = new UserAuth();
        model.addAttribute("user", user);

//        UserAuth user = UserContext.getCurrentUser();
//        model.addAttribute("user", user);
//        // 版本号
//        model.addAttribute("version", version);
//        // 更新日志
//        model.addAttribute("updateLog", JSON.toJSONString(busTestDao.getUpdateLog()));

        return "example/index_view";
    }

}
